home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0294feb.archive
/
000009_donews!crash!fr…leton.ca!ao443_Fri, 4 Feb 94 01:40:03 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
2KB
Received: by bkhouse.cts.com (V1.17-beta/Amiga)
id <1q2u@bkhouse.cts.com>; Fri, 4 Feb 94 01:40:03 PST
Received: from crash by donews.cts.com with uucp
(Smail3.1.28.1 #18) id m0pSDz8-0001OnC; Thu, 3 Feb 94 19:01 EST
Received: from freenet-news.carleton.ca by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0pSDv7-0000ajC; Thu, 3 Feb 94 15:57 PST
Received: from freenet.carleton.ca by freenet-news.carleton.ca (4.1/SMI-4.0)
id AA27308; Thu, 3 Feb 94 18:57:29 EST
Received: from localhost (ao443@localhost) by freenet.carleton.ca (8.6.4/8.6.4) id SAA24368; Thu, 3 Feb 1994 18:56:58 -0500
Date: Thu, 3 Feb 1994 18:56:58 -0500
Message-Id: <199402032356.SAA24368@freenet.carleton.ca>
Reply-To: ao443@freenet.carleton.ca
From: ao443@freenet.carleton.ca (Jason Maskell)
To: amigae@bkhouse.cts.com
Subject: Disk info (as requested)
Rob Nottage asked for help on this, so here's the writeup on how to
get volume names, sizes, etc... (Modified for beginners as well, as I know
you aren't, Rob.)
Ok, first of all, to figure out whether a device is useable in a
dir utility, use the function IsFileSystem(name). So
IF IsFileSystem('PAR:')
...
ENDIF
The other thing you need to know about is the InfoData structure,
and the Info() command. InfoData is the following and must be longword
aligned. (Which I'm sure is probably taken care of in E, if you allocate it
in your DEF.)
OBJECT InfoData
numsofterrors:LONG
unitnumber:LONG
diskstate:LONG
numblocks:LONG /* So, these three are how you */
numblocksused:LONG /* Compute size remaining, of course. */
bytesperblock:LONG
disktype:LONG
volumenode:LONG /*<- This is a BCPL pointer to a node */
inuse:LONG /* So, to use it as an E ptr, you must */
ENDOBJECT /* ptr:=Shl(ptr,2) (I believe.) */
To get this structure, use the Dos call Info(lock,infodata). Where
lock is a BCPL pointer to a lock (obtained from Open or Lock), and infodata
is a pointer to an allocated InfoData structure. This way you can use any
open file to obtain the volume information.
That should pretty much do it. If example code is needed, I'll be
happy to post it.
--
'You see son, if this were Star Trek, we'd be negotiating with this Kobold.'
- Unknown Angband Player